<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增实有单位基本信息')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-unit-add" th:object="${base}">
        <input name="dwdzDzbm" th:value="${base.dzbm}" type="hidden" required>
        <input name="sssj" th:field="*{sssj}" type="hidden">
        <input name="ssfxj" th:value="${base.ssfj}" type="hidden">
        <input name="sspcs" th:field="*{sspcs}" type="hidden">
        <input name="sszrq" th:value="${base.ssjwq}" type="hidden">
        <input name="djdwGajgjgdm" th:field="*{djdwGajgjgdm}" type="hidden">
        <input name="ssjlxxqDzbm" th:field="*{ssjlxxqDzbm}" type="hidden">
        <input name="djrZh" th:field="*{djrZh}" type="hidden">
        <input name="zxdhzb" th:field="*{zxdhzb}" type="hidden">
        <input name="zxdzzb" th:field="*{zxdzzb}" type="hidden">
        <input name="sssqjwwgDzbm" th:field="*{sssqjwwgDzbm}" type="hidden">
        <input name="sssqjcwgDzbm" th:field="*{sssqjcwgDzbm}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">单位名称：</label>
            <div class="col-sm-8">
                <input name="dwmc" th:value="${base.dzmc}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">单位分类：</label>
            <div class="col-sm-8">
                <select name="gaglDwfl" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_FWSSZT')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">实际名称：</label>
            <div class="col-sm-8">
                <input name="sjmc" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单位英文名称：</label>
            <div class="col-sm-8">
                <input name="dwywmc" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单位英文缩写：</label>
            <div class="col-sm-8">
                <input name="dwywsx" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">组织机构代码：</label>
            <div class="col-sm-8">
                <input name="zzjgdm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单位类型：</label>
            <div class="col-sm-8">
                <select name="dwlxdm" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_DWLX_2')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经济类型：</label>
            <div class="col-sm-8">
                <select name="jjlxdm" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_JJLX')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">行业类别：</label>
            <div class="col-sm-8">
                <select name="hylbdm" class="form-control m-b" th:with="type=${@dict.getParamValue('SWJG_DWSSHY')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开业日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="kyrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">停业日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="tyrq01" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">主营：</label>
            <div class="col-sm-8">
                <input name="jyfwzy" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">兼营：</label>
            <div class="col-sm-8">
                <input name="jyfwjy" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经营面积：</label>
            <div class="col-sm-8">
                <input name="jymjMjpfm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经营方式：</label>
            <div class="col-sm-8">
                <input name="jyfs" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否有营业执照：</label>
            <div class="col-sm-8">
                <select name="sfyyyzz" class="form-control m-b" th:with="type=${@dict.getParamValue('SFZD_DQJC')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">营业执照号：</label>
            <div class="col-sm-8">
                <input name="yyzzh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">执照有效期_起始日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="yyzzyxqQsrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">执照有效期_截止日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="yyzzyxqJzrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">注册资金万元：</label>
            <div class="col-sm-8">
                <input name="zczb" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系电话：</label>
            <div class="col-sm-8">
                <input name="lxdh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">省市县区：</label>
            <div class="col-sm-8">
                <input name="dwdzSsxqdm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">详细地址：</label>
            <div class="col-sm-8">
                <input name="dwdzQhnxxdz" th:value="${base.dzmc}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">标签：</label>
            <div class="col-sm-8">
                <input name="bq" th:value="${bq}" type="hidden">
                <input id="labelName" th:value="${labelNames}" class="form-control" type="text" readonly>
                <div id="tree" class="ztree" style="border: 1px solid #e5e6e7"></div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">网址：</label>
            <div class="col-sm-8">
                <input name="wz" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法定代表人公民身份号码：</label>
            <div class="col-sm-8">
                <input name="fddbrGmsfhm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法定代表人姓名：</label>
            <div class="col-sm-8">
                <input name="fddbrXm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法定代表人证件种类：</label>
            <div class="col-sm-8">
                <select name="fddbrCyzjdm" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_ZJZL2')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法定代表人证件号码：</label>
            <div class="col-sm-8">
                <input name="fddbrZjhm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法定代表人外文姓：</label>
            <div class="col-sm-8">
                <input name="fddbrWwx" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法定代表人外文名：</label>
            <div class="col-sm-8">
                <input name="fddbrWwm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法定代表人联系电话：</label>
            <div class="col-sm-8">
                <input name="fddbrLxdh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">重点单位标识：</label>
            <div class="col-sm-8">
                <input name="zddwbs" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">单位管理级别：</label>
            <div class="col-sm-8">
                <input name="dwgljb" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否九小场所：</label>
            <div class="col-sm-8">
                <select name="sfjxcs" class="form-control m-b"
                        th:with="type=${@dict.getParamValue('SFZD_DQJC')}">
                    <option th:each="dict : ${type}"
                            th:text="${dict.itemText}"
                            th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">九小场所分类：</label>
            <div class="col-sm-8">
                <select name="jxcsfl" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_JXCSFL')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">公安机关名称：</label>
            <div class="col-sm-8">
                <input name="djdwGajgmc" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">登记人姓名：</label>
            <div class="col-sm-8">
                <input name="djrXm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">登记时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="djsj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">更新账户：</label>
            <div class="col-sm-8">
                <input name="gxzh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">更新部门：</label>
            <div class="col-sm-8">
                <input name="gxbm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">核录部门：</label>
            <div class="col-sm-8">
                <input name="hlbm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">核录时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="hlsj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">核录人：</label>
            <div class="col-sm-8">
                <input name="hlr" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">核录标识：</label>
            <div class="col-sm-8">
                <select name="hlbz" class="form-control m-b" th:with="type=${@dict.getParamValue('YBSS_HLBZ')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">最近检查合格标志：</label>
            <div class="col-sm-8">
                <input name="zjjchgbz" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">最近检查日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="zjjcrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">下次检查日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="xcjcrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">检查账户：</label>
            <div class="col-sm-8">
                <input name="jczh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">数据来源：</label>
            <div class="col-sm-8">
                <select name="sjly" class="form-control m-b" th:with="type=${@dict.getParamValue('YBSS_SJLY')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"
                            th:field="${base.sjly}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">安全出入口通道数：</label>
            <div class="col-sm-8">
                <input name="aqcrktds" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">从业人员总数：</label>
            <div class="col-sm-8">
                <input name="cyryzs" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经营状态：</label>
            <div class="col-sm-8">
                <select name="jyzt" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_JYZT')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">主管单位：</label>
            <div class="col-sm-8">
                <input name="zgdw" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">公安机关备案时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="gajgbasj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">三防设施情况：</label>
            <div class="col-sm-8">
                <input name="sfss" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">保卫负责人公民身份号码：</label>
            <div class="col-sm-8">
                <input name="bwfzrGmsfhm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">保卫负责人姓名：</label>
            <div class="col-sm-8">
                <input name="bwfzrXm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">保卫负责人联系电话：</label>
            <div class="col-sm-8">
                <input name="bwfzrLxdh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">互联网审核人：</label>
            <div class="col-sm-8">
                <input name="hlwshr" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">互联网审核时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="hlwshsj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单位详细地址：</label>
            <div class="col-sm-8">
                <input name="dwdz" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">注销时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="zxsj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">注销账号：</label>
            <div class="col-sm-8">
                <input name="zxzh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">注销时间标志：</label>
            <div class="col-sm-8">
                <input name="zxbz" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">审批人：</label>
            <div class="col-sm-8">
                <input name="spr" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">审批时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="spsj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">注销原因：</label>
            <div class="col-sm-8">
                <input name="zxyy" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">类行政区划代码：</label>
            <div class="col-sm-8">
                <input name="dwdzLxzqydm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地址编码：</label>
            <div class="col-sm-8">
                <input name="zcdzDzbm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">省市：</label>
            <div class="col-sm-8">
                <input name="zcdzSsxqdm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">类行政区域：</label>
            <div class="col-sm-8">
                <input name="zcdzLxzqydm" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">区划内详细地址：</label>
            <div class="col-sm-8">
                <input name="zcdzQhnxxdz" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地址名称：</label>
            <div class="col-sm-8">
                <input name="zcdzDzmc" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">网络检查_合格标志：</label>
            <div class="col-sm-8">
                <input name="wljcZjjchgbz" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">网络检查_最近检查日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="wljcZjjcrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">网络检查_下次检查日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="wljcXcjcrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">消防检查_合格标志：</label>
            <div class="col-sm-8">
                <input name="xfjcZjjchgbz" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">消防检查_最近检查日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="xfjcZjjcrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">消防检查_下次检查日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="xfjcXcjcrq" class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">网络检查_检查账户：</label>
            <div class="col-sm-8">
                <input name="wljcJczh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">消防检查_检查账户：</label>
            <div class="col-sm-8">
                <input name="xfjcJczh" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否重点：</label>
            <div class="col-sm-8">
                <select name="sfzd" class="form-control m-b" th:with="type=${@dict.getParamValue('SFZD_DQJC')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">是否定期检查：</label>
            <div class="col-sm-8">
                <select id="dqjc" onchange="gradeChange()" class="form-control m-b"
                        th:with="type=${@dict.getParamValue('SFZD_DQJC')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group" id="szjczq" style="visibility:hidden">
            <!--document.getElementById("szjczq").style.visibility="hidden";
            document.getElementById("szjczq").style.visibility="visible";-->
            <label class="col-sm-3 control-label">检查周期（天）：</label>
            <div class="col-sm-8">
                <input name="jczq" class="form-control" type="number" oninput="value=value.replace(/[^\d]/g,'')">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var prefix = ctx + "control/unit"

    $("#form-unit-add").validate({
        focusCleanup: true
    });

    function gradeChange() {
        var $sfdqjc = $('#dqjc option:selected');
        if ($sfdqjc.val() == "Y") {
            document.getElementById("szjczq").style.visibility = "visible";
        } else {
            document.getElementById("szjczq").style.visibility = "hidden";
        }
    }

    $(function () {
        var url = ctx + "control/label/treeData";
        var options = {
            id: "tree",
            url: url,
            check: {enable: true},
            expandLevel: 0,
            onCheck: onCheck
        };
        $.tree.init(options);
    });

    function onCheck() {
        $('input[name="bq"]').val(getChecked('id'));
        $('#labelName').val(getChecked('name'));
    }

    function getChecked(column) {
        var nodes = $._tree.getCheckedNodes(true);
        return $.map(nodes, function (row) {
            if (!row.isParent) {
                return row[column]
            }
        }).join();
    }

    function submitHandler() {
        if ($.validate.form()) {
            save(prefix + "/add", $('#form-unit-add').serialize(), function (res) {
                if (res.success) {
                    $.modal.close();
                    parent.closeNowTab();
                    window.parent.$.modal.openTab("实有单位", $.common.setURL("/control/unit"));
                }
            });
        }
    }

    function save(url, data, callback) {
        var config = {
            url: url,
            type: "post",
            dataType: "json",
            data: data,
            beforeSend: function (request) {
                request.setRequestHeader("X-Access-Token", storage.get("token"));
            },
            success: function (result) {
                callback(result);
            }
        };
        $.ajax(config)
    }

    $("input[name='kyrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='tyrq01']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='yyzzyxqQsrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='yyzzyxqJzrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='djsj']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='hlsj']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='zjjcrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='xcjcrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='gajgbasj']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='hlwshsj']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='zxsj']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='spsj']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='wljcZjjcrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='wljcXcjcrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='xfjcZjjcrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='xfjcXcjcrq']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>
